package com.qf.mxapp.result;

import lombok.Data;

/**
 * 返回值封装
 * @author xy
 */
@Data
public class ResponseData<T> {

    private Integer code;


    private String msg;

    private T data;

    public ResponseData() {
    }

    public ResponseData(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public ResponseData(ApiStatus apiStatus) {
        this.code = apiStatus.getCode();
        this.msg = apiStatus.getMessage();
    }

    public ResponseData(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
    public ResponseData(ApiStatus apiStatus, T data) {
        this.code = apiStatus.getCode();
        this.msg = apiStatus.getMessage();
        this.data = data;
    }
}
